package com.leecode.hot100;

/**
 * @description:
 *
 * @date: 2023/2/2 12:11
 * @author: yaoshubin
 * @version: 1.0
 */
public class LeeCode70_爬楼梯 {

    public static void main(String[] args) {

        int i = climbStairs(1);

        System.out.println(i);
    }


    public  static int climbStairs(int n) {
        // a + b
        int a =1, b = 1;

        for (int i = 2; i <= n; i++) {
            int c = a+b;
            a = b;
            b = c;
        }

       return b;
    }

}
